import request from '@/utils/request';

const processTaskApi = {};

processTaskApi.claim = (taskId) => {
  return request({
		url: '/activiti-api/process-task/claim/' + taskId,
		method: 'post',
	})
}
processTaskApi.retTask = (taskId) => {
  return request({
		url: '/activiti-api/process-task/ret-task/' + taskId,
		method: 'post',
	})
}

processTaskApi.roleTodo = (params) => {
	return request({
		url: '/activiti-api/process-task/role-todo',
		method: 'get',
		params: params,
	})
}

processTaskApi.todo = (params) => {
	return request({
		url: '/activiti-api/process-task/todo',
		method: 'get',
		params: params,
	})
}

//////////////////////////////////////////////////////
processTaskApi.page = (params) => {
	return request({
		url: '/activiti-api/process-task/page',
		method: 'get',
		params: params,
	})
}
processTaskApi.completeTask = (taskId, params) => {
	return request({
		url: '/activiti-api/process-task/complete-task/' + taskId,
		method: 'post',
		data: params,
	})
}
processTaskApi.image = (taskId) => {
	return request({
		url: '/activiti-api/process-task/image/' + taskId,
		method: 'get',
		responseType: 'arraybuffer',
	})
}

export default processTaskApi